package com.sunny.design.chain.auth.normal;


import com.sunny.design.chain.auth.Member;

public class MemberService {

    /**
     * 通过责任链构建执行流程
     */
    public void login(String loginName, String loginPass){
        Handler validateHandler = new ValidateHandler();
        Handler loginHandler = new LoginHandler();
        Handler authHandler = new AuthHandler();

        validateHandler.next(loginHandler);
        loginHandler.next(authHandler);

        validateHandler.doHandler(new Member(loginName,loginPass));
    }

}
